//企业头部
import React, { Component } from 'react'
import {
    View,
    Text,
    TouchableOpacity,
} from 'react-native';

import { Cresumetop_Style as styles } from '../../../../styles';
import Icon from 'react-native-vector-icons/Ionicons';
import Autoinput from '../../../util/inputUtil';
var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;

export default class Cdescribe_all extends Component {
    constructor(props) {
        super(props);
        this.state = { postionDescription: '' };
    };
    render() {
        return (
            <View style={{ alignItems: "center" }}>
                <View style={[styles.top_all, {
                    width: width * 1,
                    elevation: 5,
                    shadowColor: 'black',
                    shadowOpacity: 1,
                    shadowRadius: 5
                }]}>

                    <TouchableOpacity activeOpacity={1} style={styles.top_back} onPress={() => { this.props.navigation.goBack() }}>
                        <Icon
                            name={'ios-arrow-back'}
                            size={25}
                            color={'#ffffff'} />
                    </TouchableOpacity>

                    <Text style={styles.top_text}>详细描述</Text>
                    <TouchableOpacity activeOpacity={1} style={styles.top_warn} onPress={() => {
                        this.props.navigation.state.params.rollback(this.state.postionDescription);
                        this.props.navigation.goBack();
                    }}>
                        <Text style={styles.top_text}>保存</Text>
                    </TouchableOpacity>
                </View >

                <View style={{ width: width * 0.9, backgroundColor: "#f6f6f6", borderRadius: 3, minHeight: 200, padding: 5, marginTop: 20 }}>
                    <Autoinput
                        function={this.postionDescription_f.bind(this)}
                        text={this.props.navigation.state.params.text}
                    />
                </View>

            </View>
        )
    }
    postionDescription_f(a) {
        this.setState({ postionDescription: a });
    }
}